﻿@using WebUI.Areas.Admin.Models
@using WebUI.Extensions
@using Core
@using Domain
@{
	Layout = null;
	Sys_Menu currentSysMenu = null;
	if (ViewBag.PageHeader == null || ViewBag.PageHeaderDescription == null || ViewBag.BreadcrumbList == null)
	{
		currentSysMenu = ViewContext.RouteData.GetSysMenuByRoute();
	}
	if (ViewBag.PageHeader == null)
	{
		ViewBag.PageHeader = currentSysMenu?.Name ?? "";
	}
	if (ViewBag.PageHeaderDescription == null)
	{
		ViewBag.PageHeaderDescription = currentSysMenu?.Name ?? "";
	}
	if (ViewBag.BreadcrumbList == null)
	{
		IList<BreadcrumbItem> breadcrumbList = new List<BreadcrumbItem>();
		Sys_Menu menu = currentSysMenu;
		while (menu != null)
		{
			breadcrumbList.Insert(0, new BreadcrumbItem(menu.Name));
			// 循环(递归)查找父级菜单
			menu = menu.ParentMenu;
		}
		ViewBag.BreadcrumbList = breadcrumbList;
	}
}

<link rel="stylesheet" href="/dist/AdminLTE/bower_components/bootstrap/dist/css/bootstrap.min.css">
<!-- Font Awesome -->
<link rel="stylesheet" href="/dist/AdminLTE/bower_components/font-awesome/css/font-awesome.min.css">
<!-- Ionicons -->
<link rel="stylesheet" href="/dist/AdminLTE/bower_components/Ionicons/css/ionicons.min.css">
<!-- Theme style -->
<link rel="stylesheet" href="/dist/AdminLTE/dist/css/AdminLTE.min.css">
<link rel="stylesheet" href="/dist/AdminLTE/dist/css/skins/skin-blue.min.css">
<!--[if lt IE 9]>
	<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
	<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
@RenderSection("head", false)

<div style="height: 100%; background-color: #ecf0f5;">
	<!-- Content Header (Page header) -->
	<section class="content-header">
		<h1>
			@ViewBag.PageHeader
			<small>@ViewBag.PageHeaderDescription</small>
		</h1>
		<ol class="breadcrumb" data-pjax>
			<li><a href="@Url.Action("Default", "Home", new { area = "Admin" })"><i class="fa fa-dashboard"></i> Home</a></li>
			@foreach (BreadcrumbItem item in ViewBag.BreadcrumbList)
			{
				@item.GenerateHtmlTag()
			}
		</ol>
	</section>
	<!-- Main content -->
	<section class="content container-fluid">
		@RenderBody()
	</section>
	<!-- /.content -->
</div>

<!-- jQuery -->
<script src="/Scripts/jquery-1.12.0.min.js"></script>
<!-- Bootstrap 3.3.7 -->
<script src="/dist/AdminLTE/bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
<!-- AdminLTE App -->
<script src="/dist/AdminLTE/dist/js/adminlte.min.js"></script>
<script src="/dist/pjax/jquery.pjax.js"></script>
<script src="~/Scripts/jquery.validate.min.js"></script>
<script src="~/Scripts/jquery.validate.unobtrusive.min.js"></script>
<script src="~/Scripts/jquery.unobtrusive-ajax.min.js"></script>
@RenderSection("body", false)
